package com.lnsf.bookstore.system.cart.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.cart.dao.CartMapper;
import com.lnsf.bookstore.system.cart.service.CartService;
import com.lnsf.bookstore.system.cart.vo.Cart;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class CartServiceImpl  implements CartService{

    @Autowired
    private CartMapper cartMapper;

    @Override
    public PageInfo<Cart> queryList(Map<String, Object> params) {
        PageHelper.startPage(Integer.parseInt(params.get("page").toString()),Integer.parseInt(params.get("limit").toString()));
        return new PageInfo<Cart>(cartMapper.selectAll(params));
    }
}
